1. Field of the Invention
The present invention relates to an image processing apparatus, an image processing method, and a storage medium.
2. Description of the Related Art
In calculation processing of image processing apparatuses that perform image deformation, many apparatuses first store input pixels, corresponding to a screen, in memory. With the use of inverse transformation of coordinate transformation, coordinate values of input pixels are calculated based on coordinate values of output pixels in order of scanning the output pixels. Furthermore, based on the integer part of the input-pixel coordinates obtained by inverse transformation, neighborhood pixels of an input pixel are read out of the memory, and with the use of the decimal part of the coordinates of the input pixel and neighborhood pixels, interpolation is performed to determine an output pixel value. By repeatedly performing the above-described operations, image processing for image deformation is realized.
Meanwhile, in image processing apparatuses for image deformation that can decrease the peak value of a necessary memory band, output coordinates are calculated by performing coordinate transformation on input pixels that are input in order of scanning. Based on the integer part of the output coordinates, the storage destination address in the memory is calculated. Furthermore, by performing inverse transformation of coordinate transformation on the integer part of the output coordinates, coordinates in the input image are obtained. When the integer part of the coordinates obtained by inverse transformation agrees with the coordinates of the original input pixel, an output pixel value is obtained by interpolation calculation using the input pixel, the neighborhood pixels, and the decimal part of the coordinates obtained by inverse transformation of coordinate transformation. The obtained pixel value is stored in the storage destination address obtained before.
In order to achieve the designated deformed shape as closely as possible and also for the sake of interpolation calculation, it is better to perform the aforementioned coordinate transformation and the inverse transformation of coordinate transformation as highly precisely as possible (hereinafter these transformation will collectively be referred to as “coordinate calculation”). However, in order to perform projection transformation in image deformation, high-precision addition, multiplication, and division are necessary in coordinate calculation. In execution of such coordinate calculation, sometimes sufficient calculation precision cannot be achieved because of problems in the amount of circuits or operating frequencies in a case of hardware, and performance problems in a case of software.
In view of the aforementioned problems, the second embodiment of Japanese Patent Laid-Open No. 6-149993 discloses a method of performing approximation calculation in the neighborhood of a pixel of interest when high-precision coordinate calculation is performed. It also discloses that, when division is performed, both divisor and dividend are doubled until the MSB (Most Significant Bit) of the divisor becomes 1.
Because approximation calculation is performed in the method disclosed in Japanese Patent Laid-Open No. 6-149993, it is difficult to achieve high-precision calculation for high-resolution images or large image deformation. Furthermore, because doubling both divisor and dividend until the MSB of the divisor becomes 1 must to be performed for each division of coordinate calculation, it causes problems of an increased amount of calculation and large power consumption.